<!DOCTYPE html>
<html>

<head lang="en">
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
	<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width,height=device-height" />
	<title>志愿者打卡器</title>

	<link rel="stylesheet" href="dist/css/app.css">
	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

	<script src="//cdn.bootcss.com/jszip/3.0.0/jszip.min.js"></script>
</head>
<body>
<div class="agreeManager">
	<div class="title">
		<p class="noTitle">神秘大礼</p>
		<p>连续5年，每年最高赔偿额</p>
		<p>150万的志愿专项保险</p>
	</div>
	<article>
		<div class="text">
			<h3>亲爱的志愿伙伴</h3>
			<p>恭喜您为志愿服务装备了属于自己的机甲战袍！从此你可以自由、无虑地从事自己喜爱的志愿服务！在线领取、在线理赔，互联网+志愿保障将更符合你的生活方式！</p>
			<p>由志趣基金会提供的志愿服务专用保险保障包括第三方责任、救护车急救、意外医疗、住院津贴、意外残疾、意外身故、猝死等七方面。</p>
		</div>
		<div class="text">
			<h3>在线领取的两个步骤：</h3>
			<p>1.开通平安银行保险理赔专用账户。</p>
			<p>2.获取志愿专项保险</p>
		</div>
	</article>
	<div class="bot-title">
		<div class="msg">
			<input id="checkbox" name="checkbox" type="checkbox"/>
			<span>同意 <a  href="dist/readme.pdf">《志愿服务保险保障细则》</a> </span>
		</div>
		<a class="next btn">领取神秘大礼</a>
	</div>
</div>
</body>
<script src="libs/qrcode/qrcode.min.js"></script>
<script>
	var member;
	function receive(){
		member = JSON.parse(window.sessionStorage.getItem("member"));
		var yaoqingma = window.sessionStorage.getItem("yaoqingma");

		$.ajax({
			url: "http://pingan2016.dakaqi.cn/spreadInsurance/createOrder",
			type: 'post',
			dataType: 'json',
			contentType: 'application/json; charset=utf-8',
			data: JSON.stringify({
				"channelCode":"11",
				"businessCode":"11",
				"memberId":member.memberID,
				"inviteCode":yaoqingma

			}),
			error: function(){}, //错误执行方法
			success: function(data){
				// console.log(datas["obj"])
				if (data["code"]==0) {

					$.ajax({
						url: "https://pab.cvssp.cn/v1/dakaqi/checkAuthCode",
						type: 'post',
						dataType: 'json',
						contentType: 'application/json; charset=utf-8',
						data: JSON.stringify({
							"inviteCode":yaoqingma,
							"idNo":data.data.cardNo,
							"realName":data.data.name,
							"mobile":data.data.mobile,
							"volunteerCode":data.data.volunteerCode,
							"orderCode":data.data.id
						}),
						error: function(){}, //错误执行方法
						success: function(data){
							// console.log(datas["obj"])
							if (data.status==200) {
								window.location.href=data.obj.redirectUrl;
							}else{
								alert(data.msg);
							}
						}//成功执行方法
					})

				}else{
					alert(data.message);
				}
			}//成功执行方法
		})
	}

	$(".next").click(function(){
		if($("#checkbox").is(':checked')){
			receive();
		}else{
			alert("未同意《志愿服务保险保障细则》");
		}
	})
</script>

</html>
